package cn.net.wanji.utils;

import lombok.extern.log4j.Log4j2;

/**
 * @author guodejun
 * @createTime 2022/11/10 11:14
 * @description
 */
@Log4j2
public class LogUtils {

    public static void errorLog(Exception e) {
        StackTraceElement[] stackTrace = e.getStackTrace();
        StringBuilder sb = new StringBuilder();
        sb.append(e.getMessage()).append("\r\n");

        for (StackTraceElement stackTraceElement : stackTrace) {
            sb.append(stackTraceElement.toString()).append("\r\n");
        }
        log.error(sb.toString());
    }

}
